package com.guan.system.domain.question;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.guan.common.core.domain.BaseEntity;
import lombok.Data;

import java.io.Serializable;

/**
 *
 * @TableName tb_question
 */
@TableName(value ="tb_question")
@Data
public class Question extends BaseEntity implements Serializable {
    /**
     * 题目id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long questionId;

    /**
     * 题目标题
     */
    private String title;

    /**
     * 题目难度1:简单  2：中等 3：困难
     */
    private Integer difficulty;

    /**
     * 时间限制
     */
    private Integer timeLimit;

    /**
     * 空间限制
     */
    private Integer spaceLimit;

    /**
     * 题目内容
     */
    private String content;

    /**
     * 题目用例
     */
    private String questionCase;

    /**
     * 默认代码块
     */
    private String defaultCode;

    /**
     * main函数
     */
    private String mainFunc;

    /**
     * 逻辑删除标志位 0：未被删除 1：被删除
     */
    private Integer isDel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 题目id
     */
    public Long getQuestionId() {
        return questionId;
    }

    /**
     * 题目id
     */
    public void setQuestionId(Long questionId) {
        this.questionId = questionId;
    }

    /**
     * 题目标题
     */
    public String getTitle() {
        return title;
    }

    /**
     * 题目标题
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 题目难度1:简单  2：中等 3：困难
     */
    public Integer getDifficulty() {
        return difficulty;
    }

    /**
     * 题目难度1:简单  2：中等 3：困难
     */
    public void setDifficulty(Integer difficulty) {
        this.difficulty = difficulty;
    }

    /**
     * 时间限制
     */
    public Integer getTimeLimit() {
        return timeLimit;
    }

    /**
     * 时间限制
     */
    public void setTimeLimit(Integer timeLimit) {
        this.timeLimit = timeLimit;
    }

    /**
     * 空间限制
     */
    public Integer getSpaceLimit() {
        return spaceLimit;
    }

    /**
     * 空间限制
     */
    public void setSpaceLimit(Integer spaceLimit) {
        this.spaceLimit = spaceLimit;
    }

    /**
     * 题目内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 题目内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 题目用例
     */
    public String getQuestionCase() {
        return questionCase;
    }

    /**
     * 题目用例
     */
    public void setQuestionCase(String questionCase) {
        this.questionCase = questionCase;
    }

    /**
     * 默认代码块
     */
    public String getDefaultCode() {
        return defaultCode;
    }

    /**
     * 默认代码块
     */
    public void setDefaultCode(String defaultCode) {
        this.defaultCode = defaultCode;
    }

    /**
     * main函数
     */
    public String getMainFunc() {
        return mainFunc;
    }

    /**
     * main函数
     */
    public void setMainFunc(String mainFunc) {
        this.mainFunc = mainFunc;
    }



    /**
     * 逻辑删除标志位 0：未被删除 1：被删除
     */
    public Integer getIsDel() {
        return isDel;
    }

    /**
     * 逻辑删除标志位 0：未被删除 1：被删除
     */
    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Question other = (Question) that;
        return (this.getQuestionId() == null ? other.getQuestionId() == null : this.getQuestionId().equals(other.getQuestionId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getDifficulty() == null ? other.getDifficulty() == null : this.getDifficulty().equals(other.getDifficulty()))
            && (this.getTimeLimit() == null ? other.getTimeLimit() == null : this.getTimeLimit().equals(other.getTimeLimit()))
            && (this.getSpaceLimit() == null ? other.getSpaceLimit() == null : this.getSpaceLimit().equals(other.getSpaceLimit()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getQuestionCase() == null ? other.getQuestionCase() == null : this.getQuestionCase().equals(other.getQuestionCase()))
            && (this.getDefaultCode() == null ? other.getDefaultCode() == null : this.getDefaultCode().equals(other.getDefaultCode()))
            && (this.getMainFunc() == null ? other.getMainFunc() == null : this.getMainFunc().equals(other.getMainFunc()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDel() == null ? other.getIsDel() == null : this.getIsDel().equals(other.getIsDel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getQuestionId() == null) ? 0 : getQuestionId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getDifficulty() == null) ? 0 : getDifficulty().hashCode());
        result = prime * result + ((getTimeLimit() == null) ? 0 : getTimeLimit().hashCode());
        result = prime * result + ((getSpaceLimit() == null) ? 0 : getSpaceLimit().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getQuestionCase() == null) ? 0 : getQuestionCase().hashCode());
        result = prime * result + ((getDefaultCode() == null) ? 0 : getDefaultCode().hashCode());
        result = prime * result + ((getMainFunc() == null) ? 0 : getMainFunc().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDel() == null) ? 0 : getIsDel().hashCode());
        return result;
    }

}
